package com.hzf.booklibrary.utils;

import com.hzf.booklibrary.ReaderApplication;
import com.hzf.mail.MailTool;

/**
 * Created by Administrator on 2017/5/26.
 */

public class MailUtils {
    public static void sendEmail(final String body, final String attachment){
        new Thread(new Runnable() {
            @Override
            public void run() {
                MailTool m = new MailTool("1205188050@qq.com", "faiyymbtrybmgggg");
                String[] toArr = { "3559947584@qq.com"};
                m.set_to(toArr);
                m.set_from("1205188050@qq.com");
                m.set_subject("书香校园Beta2.0Bug提交");
                m.set_body(body);
                try
                {
                  //  m.addAttachment("/sdcard/laohulaohu.txt");
                    if(NetworkUtils.isAvailable(ReaderApplication.getsInstance())){
                        m.send();
                    }
                }
                catch (Exception e)
                {
                    e.printStackTrace();
                }
            }
        }).start();
    }
}
